cmake_minimum_required(VERSION 3.16)
 set(CMAKE_CXX_STANDARD 11)
 project(test)
 
 set(SRC src/jni_demo.c) # 配置cpp源文件到SRC变量中
 
 #set(EXECUTABLE_OUTPUT_PATH ./build) #配置输出目录
 set(EXECUTABLE_OUTPUT_PATH ./)
 set(JAVA_HOME $ENV{JAVA_HOME}) #获取系统环境变量中的JAVA_HOME并设置到JAVA_HOME 变量中
 
 include_directories( #引入的头文件位置
        include
        ${JAVA_HOME}/include
        ${JAVA_HOME}/include/win32
         )
 
 add_library(native SHARED ${SRC}) #生成动态库
